<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        <p>1</p>
        <p>2</p>
        <ul>
            <li>张三</li>
            <li>李四</li>
            <li>王五</li>
        </ul>

    </div>
    <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    <script>
        console.log($('ul li:eq(0)').text());
    </script>
</body>

</html>